﻿<!DOCTYPE html>
	<html>
	<head>
	<meta http-equiv="x-ua-compatible" content="IE=8"/>
	 <link rel="stylesheet" type="text/css" href="styles10.css">
	<style type="text/css">
	html, body {
		padding:0; margin:0; height:100%;
		background:#ffffff; /* Old browsers */
		background:-moz-linear-gradient(top,  #ffffff 0%, #f0f0f0 100%); /* FF3.6-15 */
		background:-webkit-linear-gradient(top,  #ffffff 0%,#f0f0f0 100%); /* Chrome10-25,Safari5.1-6 */
		background:linear-gradient(to bottom,  #ffffff 0%,#f0f0f0 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
		filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f0f0f0',GradientType=0 ); /* IE6-9 */
	}
	.container {font:caption; padding:0.7em 1.57em;} 
	#btn_cnt {padding:0.7em 1em; background:#e5e5e5; border-top:1px solid #d0d0d0; position:absolute;bottom:0; right:0; left:0; text-align:center;}
	#div_text {padding-top:26px; padding-bottom:36px;}
	</style>
	</head>
	<body>
		<div id="div_text" class="container"></div>
		<div id="btn_cnt"> 
			<button id="btn_ok">是</button>
			<button id="btn_cancel">否</button>
		</div>
		<script>
			function close_window() {
				window.open('', '_self', '');
				window.close();
			}

			var parsed_args;
			var callback;
			try {
				parsed_args = window.external.dialogArguments.toArray();
			}
			catch(e) {
			}
			if (parsed_args) {
				document.title = parsed_args[0];
				window.div_text.innerText = parsed_args[1];
				if (parsed_args[5] == 'center') window.div_text.style.textAlign = "center";
				var labelInnerHtml = window.btn_ok.innerHTML;
				window.btn_ok.innerHTML = labelInnerHtml.replace(/Yes/g, parsed_args[2]);
				var labelInnerHtml = window.btn_cancel.innerHTML;
				window.btn_cancel.innerHTML = labelInnerHtml.replace(/No/g, parsed_args[3]);
				callback = parsed_args[6];
			}

			var window_w = 558;
			var window_h = 425;
			window_h = Math.max(44 + window.div_text.offsetHeight + window.btn_cnt.offsetHeight, 279);
			if (window_w < window_h + 50) {
				window_w += 50;

				window.resizeTo(window_w, window_h);
				window_h = Math.max(44 + window.div_text.offsetHeight + window.btn_cnt.offsetHeight, 279);
			}

			var left = (screen.width - window_w) / 2;
			var top = (screen.height - window_h) / 2;
			window.resizeTo(window_w, window_h);
			window.moveTo(left, top);

			window.btn_ok.onclick = function () {
				close_window();
				callback && callback("ok", true);
			}

			window.btn_cancel.onclick = function () {
				callback && callback("ok", false);
				close_window();
			}

			window.document.body.focus();
			window.btn_ok.focus();
		</script>
	</body>
	</html>